#pragma once

#include "../stdafx.h"

class CFileSystem
{

public:
	CFileSystem(unsigned int userId);
	virtual ~CFileSystem();
public:

	CFile*			getFile(const char* fileName, unsigned int &fileContentSize);
	CFile*			putFile(CFile *f);
	int				getFileId(const char* fileName);
	int				getLatestRevision(int fileId);
	int				getLatestVersion(int fileId);
	int				getNextVersion(int fileId);
	char*			getDataForRevision(int revision, unsigned int &fileSize);
	void			cleanRevisionsForFile(int fileId);
	void			rollBackToVersion(int fileId, int version);
	void			setFilePermissions(int fileId, int userId, int permission);
	int				getFilePermissions(int fileId, int userId);

protected:

	sqlite3*		_fsdb;
	unsigned int	_userId;

};